﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Simple.ViewModel
{
    /// <summary>
    /// 按钮类型
    /// </summary>
    public enum ActionType
    {
        /// <summary>
        /// 查看
        /// </summary>
        Search,
        /// <summary>
        ///  添加
        /// </summary>
        Add,
        /// <summary>
        /// 编辑
        /// </summary>
        Edit,
        /// <summary>
        /// 删除
        /// </summary>
        Delete,
        /// <summary>
        /// 导出
        /// </summary>
        Export,
        /// <summary>
        ///  导入
        /// </summary>
        Import,
        /// <summary>
        /// 设置
        /// </summary>
        Set,
        /// <summary>
        /// 审核
        /// </summary>
        Audit

    }

    /// <summary>
    /// 按钮默认图标
    /// </summary>
    public class ActionTypeHelper
    {
        public static string GetDefaultIcon(ActionType actionType)
        {
            string ret = string.Empty;
            List<string> iconList = new List<string>() { 
                "fa fa-search","fa fa-plus","fa fa-edit","fa fa-cut","fa fa-cloud-download","fa fa-cloud-upload","fa fa-wrench","fa fa-check"
            };
            ret = iconList[(int)actionType];
            if (string.IsNullOrEmpty(ret))
            {
                ret = "fa fa-plus";
            }
            return ret;
        }
    }

    public enum MenuTypeEnum
    {
        菜单模块 = 1,
        普通菜单 = 2,
        菜单按钮 = 3
    }

    public class MenuTypeHelper
    {
        public static string GetMenuTypeString(int? menuType)
        {
            switch (menuType)
            {
                case (int)MenuTypeEnum.菜单按钮: return MenuTypeEnum.菜单按钮.ToString();
                case (int)MenuTypeEnum.菜单模块: return MenuTypeEnum.菜单模块.ToString();
                case (int)MenuTypeEnum.普通菜单: return MenuTypeEnum.普通菜单.ToString();
                default: return "无";
            }
        }
    }
}
